<include file="Public:header" />

<script type="text/javascript">
	function status(id,type){
	    $.get("{:U('Article/status')}", { id: id, type: type }, function(data){
			$("#"+type+"_"+id+" img").attr('src', '__PUBLIC__/statics/images/status_'+data.data+'.gif')
		},"json"); 
	}
</script>

</head>
<div class="pad-10" >
    <form name="searchform" action="{:U('Article/index')}" method="post" >
    <table width="100%" cellspacing="0" class="search-form">
        <tbody>
            <tr>
            <td>
            <div class="explain-col">
            	发布时间：
            	<input type="text" name="time_start" id="time_start" class="date" size="12" value="{$time_start}">
				<script language="javascript" type="text/javascript">
                    Calendar.setup({
                        inputField     :    "time_start",
                        ifFormat       :    "%Y-%m-%d",
                        showsTime      :    'true',
                        timeFormat     :    "24"
                    });
                </script>
                -
                <input type="text" name="time_end" id="time_end" class="date" size="12" value="{$time_end}">
				<script language="javascript" type="text/javascript">
                    Calendar.setup({
                        inputField     :    "time_end",
                        ifFormat       :    "%Y-%m-%d",
                        showsTime      :    'true',
                        timeFormat     :    "24"
                    });
                </script>
            	&nbsp;&nbsp;资讯分类：
                <select name="cate_id">
            	<option value="0">--选择分类--</option>
				<volist name="cate_list" id="val">
				<option value="{$val.id}">{$val.name}</option>
				</volist>
                <!--<volist name="cate_list['parent']" id="val">
                  <option value="{$val.id}" <if condition="$cate_id eq $val['id']"> selected="selected" </if>>{$val.name}</option>
                 <notempty name="cate_list['sub'][$val['id']]">
                    <volist name="cate_list['sub'][$val['id']]" id="sval">
                      <option value="{$sval.id}" <if condition="$cate_id eq $sval['id']"> selected="selected" </if>>&nbsp;&nbsp;&nbsp;&nbsp;{$sval.name}</option>
                      <notempty name="cate_list['sub'][$sval['id']]">
                        <volist name="cate_list['sub'][$sval['id']]" id="ssval">
                          <option value="{$ssval.id}" <if condition="$cate_id eq $ssval['id']"> selected="selected" </if>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{$ssval.cate_name}</option>
                        </volist>
                      </notempty>
                    </volist>
                  </notempty>
                </volist>--> 
              </select>
                &nbsp;关键字 :
                <input name="keyword" type="text" class="input-text" size="25" value="{$keyword}" />
                <input type="submit" name="search" class="button" value="搜索" />
        	</div>
            </td>
            </tr>
        </tbody>
    </table>
    </form>

    <form id="myform" name="myform" action="{:U('Article/delete')}" method="post">
    <div class="table-list">
    <table width="100%" cellspacing="0">
        <thead>
            <tr>
                <th width="5%">序号</th>
                <th width="1%"><input type="checkbox" value="" id="check_box" onclick="selectall('id[]');"></th>
                <th width=200 align="left">标题名称</th>
                <th width=100>所属分类</th>
                <th width=100>发布时间</th>
                <th width=30>排序值</th>
                <th width=30>推荐</th>
                <th width=30>状态</th>
            </tr>
        </thead>
    	<tbody>
        <volist name="articles" id="val" >
        <tr>
        	<td align="center">{$val.key}</td>
            <td align="center">
            <input type="checkbox" value="{$val.id}" name="id[]"></td>
            <td align="left" style="padding-left:50px;"><a href="{:U('Article/edit',array('id'=>$val['id']))}"><em style="color:black;">{$val.title}</em></a><if condition="$val['url'] neq ''"><br><a href="{$val.url}" target=_blank>{$val.url}</a></if>&nbsp;&nbsp;</td>
            <td align="center"><b>{$val.cate_name}</b></td>
            <td align="center">{$val.add_time|date="Y-m-d H:i:s",###}</td>
            <td align="center"><input  type="text" class="input-text-c input-text" value="{$val.ord}" size="4" name="orders[{$val.id}]"></td>
            <td align="center" onclick="status({$val.id},'is_best')" id="is_best_{$val.id}"><img src="__PUBLIC__/statics/images/status_{$val.is_best}.gif" /></td>
      		<td align="center" onclick="status({$val.id},'status')" id="status_{$val.id}"><img src="__PUBLIC__/statics/images/status_{$val.status}.gif" /></td>
        </volist>
    	</tbody>
    </table>

    <div class="btn">
    	<label for="check_box" style="float:left;">全选/取消</label>
    	<input type="submit" class="button" name="delete" value="删除" style="float:left;margin:0px 10px;"  onclick="return check();"/>
    	<input type="submit" class="button" name="order" onclick="document.myform.action='{:U('Article/order')}'" value="排序" style="float:left;"/>
    	<div id="pages">{$page}</div>
    </div>

    </div>
    </form>
</div>
</body>
</html>
